<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    h2 {
      text-align: center;
    }

    table {
      border-collapse: collapse;
      text-align: center;
      margin: 0 auto;
      height: 80px;
    }

    th {
      padding: 7px 40px;
    }

    table,
    th,
    td {
      border: 1px solid black;
    }
  </style>
</head>

<body>
  <h2>2022年全年银行卡余额</h2>

  <script>
    let bank = +prompt('请输入银行卡余额')
    let ele = +prompt('请输入电费')
    let water = +prompt('请输入水费')
    let online = +prompt('请输入网费')
    let remain = bank - ele - water - online
    document.write(`<table>
    <tr>
      <th>银行卡余额</th>
      <th>电费</th>
      <th>水费</th>
      <th>网费</th>
      <th>银行卡余额</th>
    </tr>
    <tr>
      <td>${bank}元</td>
      <td>${ele}元</td>
      <td>${water}元</td>
      <td>${online}元</td>
      <td>${remain}元</td>
    </tr>
  </table>`)
  </script>
</body>

</html>